/*
 * ScriptManager.h
 *
 *  Created on: 2009/02/05
 *      Author: Yongshik Cho
 */

#ifndef SCRIPTMANAGER_H_
#define SCRIPTMANAGER_H_


#include <map>
#include "core/Prerequisites.h"
#include "core/ISingleton.h"
#include "sqplus/sqplus.h"

using namespace SqPlus;

class ScriptManager : public ISingleton<ScriptManager>
{
public:
	ScriptManager();
	virtual ~ScriptManager();

public:
	static ScriptManager& GetInstance()
	{
		assert(m_pInstance);
		return *m_pInstance;
	}
	static ScriptManager* GetInstancePtr()
	{
		return m_pInstance;
	}

public:
	void load(const String& path);

	//define classes here for the scripts
	void bindScriptClasses();
	void bindManagers();

	void bindActiveClasses();
	void bindCoreClasses();
	void bindXmlClasses();
	void bindAltoClasses();

private:
	bool isExists(const String& path);

private:
	bool						mInitialized;
	map<String, SquirrelObject>	mScriptObjects;
};


#endif /* SCRIPTMANAGER_H_ */
